class Solution(object):
    def xorOperation(self, n, start):
        val = 0
        for i in range(n):
            val ^= start + 2 * i
        return val